package com.threeti.jiayusms.domain.model.defaulttemplate;

import java.util.ArrayList;
import java.util.List;

import com.threeti.jiayusms.framework.domain.support.DefaultCustomKeyDomainEntity;

public class DefaultCommunicationTemplate extends DefaultCustomKeyDomainEntity {
  private String description;
  private boolean enabled;
  
  //短信设定区->
//  private CommunicationMessage msgTemplate;
//  private CommunicationRule msgRuleTemplate;
//  private CommunicationTime msgTimeTemplate;
//  
//  private String msgNode;
//  private String msgProductType;
//  private String msgConditionType;
//  private String msgCondition;
//  private boolean msgCommunicationEnabled;
  //<-
  private List<SMSTemplateMapping> smsTemplateMappings = new ArrayList<SMSTemplateMapping>();
  
  //语音设定区->
//  private CommunicationVoice voiceTemplate;
//  private CommunicationRule voiceRuleTemplate;
//  private CommunicationTime voiceTimeTemplate;
//  
//  private String voiceNode;
//  private String voiceProductType;
//  private String voiceConditionType;
//  private String voiceCondition;
//  private boolean voiceCommunicationEnabled;
  //<-
  private List<VoiceTemplateMapping> voiceTemplateMappings = new ArrayList<VoiceTemplateMapping>();
  
  public boolean getEnabled() {
    return enabled;
  }

  public void setEnabled(boolean enabled) {
    this.enabled = enabled;
  }

  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  /**本默认模板启用 */
  public void enable() {
    setEnabled(true);
  }

  public void disable() {
    setEnabled(false);
  }

  public List<SMSTemplateMapping> getSmsTemplateMappings() {
    return smsTemplateMappings;
  }

  public void setSmsTemplateMappings(List<SMSTemplateMapping> smsTemplateMappings) {
    this.smsTemplateMappings = smsTemplateMappings;
  }

  public List<VoiceTemplateMapping> getVoiceTemplateMappings() {
    return voiceTemplateMappings;
  }

  public void setVoiceTemplateMappings(List<VoiceTemplateMapping> voiceTemplateMappings) {
    this.voiceTemplateMappings = voiceTemplateMappings;
  }
  
  public DefaultCommunicationTemplate addSMSTemplateMapping(SMSTemplateMapping smsMapping) {
    this.getSmsTemplateMappings().add(smsMapping);
    return this;
  }
  
  public DefaultCommunicationTemplate addVoiceTemplateMapping(VoiceTemplateMapping voiceMapping) {
    this.getVoiceTemplateMappings().add(voiceMapping);
    return this;
  }
  
}
